import _ from 'lodash'
import '../css/style.css'
import '../css/test1.scss'
import '../css/test2.less'
import Img from '../images/header.jpg'
import Data from '../xml/data.xml'
import printMe from '../scripts/print.js'
import ha from '../scripts/test2'
import { cube } from './math.js'

function component () {
  let element = document.createElement('div')
  element.innerHTML = _.join(['Hello', cube(5)])
  var myIcon = new Image()
  myIcon.src = Img
  element.appendChild(myIcon)
  var btn = document.createElement('button')
  btn.innerHTML = 'click me'
  btn.addEventListener('click', () => {
    printMe()
    ha()
  })
  element.appendChild(btn)
  console.log(Data)
  return element
}
document.body.appendChild(component())

if (module.hot) {
  module.hot.accept('./print.js', function () {
    console.log('updata')
    printMe()
  })
}
